home *** CD-ROM | disk | FTP | other *** search
/ ZAM 3 / ZAM 3.adf / Source / Sinusdance.AMOS / Sinusdance.amosSourceCode
Encoding:
AMOS Source Code  |  1990-12-11  |  1.2 KB  |  52 lines

  1. ' More Stuff With The Sine & Cosine Wave 
  2. '
  3. '                By
  4. '
  5. '       Graham Stephenson 1992 
  6. '
  7. ' This program will display six bobs every vertical blank at a position
  8. ' depending on the sine of a number (at both X and Y coordinates). 
  9. '
  10. ' I have no idea what you could use this program for, but someone somewhere
  11. ' will find a use for it!
  12.  
  13. Load "df0:Sprites/Letter.abk"
  14. Screen Open 0,320,200,4,Lowres
  15. Flash Off : Cls 0
  16. Double Buffer : Bob Update Off : Autoback 0
  17. Get Sprite Palette 
  18.  
  19. Dim XPOS(359),YPOS(359),BX(5),BY(5)
  20.  
  21. Degree 
  22. For T=0 To 359
  23.    XPOS(T)=140*Sin(T)
  24.    YPOS(T)=85*Cos(T)
  25. Next T
  26.  
  27. Radian 
  28.  
  29. For T=0 To 5
  30.    BX(T)=T*8
  31. Next T
  32. ' This above three lines set the "Space" between each letter, otherwise  
  33. ' all the letters will be displayed at the same position, resulting in 
  34. ' a jumbled mess.
  35.  
  36. T=0
  37.  
  38. Do 
  39.    For LOP=0 To 5
  40.       Add BX(LOP),4
  41.       Add BY(LOP),2
  42.       If BX(LOP)>359 Then BX(LOP)=0
  43.       If BY(LOP)>359 Then BY(LOP)=0
  44.       Bob LOP,160-XPOS(BX(LOP)),100-YPOS(BY(LOP)),(5-LOP)+1
  45.    Next LOP
  46.    Bob Clear : Bob Draw : Screen Swap : Wait Vbl 
  47. Loop 
  48.  
  49. ' That's all folks! Until my next piece of Source Code, Bye ...
  50. '
  51. '                                                 Graham Stephenson 19-12-92 
  52. '